<template>
        <el-card shadow="never" style="max-height: 700px; overflow: auto">
            <el-form ref="form" :model="form" :rules="rules" label-width="90px" :disabled="disabled">
                <el-card shadow="always" body-style="padding:0 20px;" v-loading="loading" >
                    <el-divider class="mt5 mb5" />
                    <el-row>
                            <div>轨迹明细</div>
                            <el-divider class="mt5 mb5" />
                            <template>
                                <el-table
                                :data="ordertrack"
                                border
                                style="width: 100%">
                                        <el-table-column
                                            prop="number"
                                            label="number"
                                            sortable>
                                        </el-table-column>
                                        <el-table-column
                                            prop="time_iso"
                                            label="time_iso">
                                        </el-table-column>
                                        <el-table-column
                                            prop="time_utc"
                                            label="time_utc">
                                        </el-table-column>
                                        <el-table-column
                                            prop="description"
                                            label="description">
                                        </el-table-column>
                                        <el-table-column
                                            prop="location"
                                            label="location">
                                        </el-table-column>
                                        <el-table-column
                                            prop="stage"
                                            label="stage">
                                        </el-table-column>
                                        <el-table-column
                                            prop="sub_status"
                                            label="sub_status">
                                        </el-table-column>
                                </el-table>
                            </template>
                    </el-row>
                </el-card>
                <el-form-item>
                    <!-- <el-button type="primary" @click="submitForm">确认 </el-button> -->
                    <el-button type="warning" @click="cancel">取消 </el-button>
                </el-form-item>
            </el-form>
        </el-card>
</template>

<script>
export default {
    name: 'EditForm',
    props: {
        findFormData: {
            type: Object,
            default: {}
        },
        editFormParams: {
            type: Object,
            default: {}
        },
        // 表单是否禁用
        disabled: {
            type: Boolean,
            default: false,
        },
        
    },
    data() {
        return {
            // 编辑表单验证规则
            rules: {
        
            },
            form: {  },
            ordertrack: {  },
          

        }
    },
    watch: {
        findFormData: {
           handler(nval) {
                if (JSON.stringify(nval) != '{}') {
                    this.$nextTick(() => {
                        this.form = nval
                        this.ordertrack = nval
                    })
                }
            },
            immediate: true,
            deep: false,
        },
        
    },
    methods: {
        // 取消按钮
        cancel() {
            this.$emit('editFormCancel')
        },

        submitForm() {
            this.$refs['form'].validate((valid, obj) => {
                if (valid) {
                    this.$emit('submitForm', this.form)
                }
            })
        },

        // 表单重置
        reset() {
            this.resetForm('form')
        }
    }
}
</script>
